import HttpKit from '@/utils/http-kit'

export default {
  /**
   * 功能描述：查询试卷
   * @param form
   */
  page1 (form) {
    return HttpKit.post(`http://127.0.0.1:8888/api/exam/list`, form).then(
      res => res.data
    ).catch(err =>{

    })
  },

  /**
   * 功能描述：新增试卷
   * @param form
   */
  Update (form) {
    return HttpKit.post(`http://127.0.0.1:8888/api/exam/add`,form).then(

      //res => res.data
    )
  },
  /**
   * 功能描述：根据Id删除试卷
   * @param paperId
   */
  deleteByPaperId (paperId) {
    return HttpKit.delete(`http://127.0.0.1:8080/base-in-back-end/common/paper/rf/${paperId}`).then(
      res => res.body
    )
  },

  preview (paperId) {
    return HttpKit.get(`http://127.0.0.1:8080/base-in-back-end/common/paper/${paperId}/topic`).then(res=>res.data
    )
  },
  showStem(stemId) {
    return HttpKit.get(`http://112.74.105.17:20003/question-bank/api/stem/${stemId}`).then(res=>res.data)
  },

  getExamById(id){
    return HttpKit.get(`http://127.0.0.1:8888/api/exam/${id}`)
      .then(
        res => res.data
      )
  }
}
